package cn.lee.test.service;

import cn.lee.test.common.base.repository.MyBaseJpaRepository;
import cn.lee.test.common.base.service.MyBaseJpaService;
import cn.lee.test.model.UserToken;
import cn.lee.test.repository.UserTokenRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : lichl(李承霖)
 * create: 2022/2/23 23:24 周三
 */

@Service
public class UserTokenService extends MyBaseJpaService<UserToken, Long>{
  
  @Autowired
  private UserTokenRepository repository;
  
  @Override
  protected MyBaseJpaRepository<UserToken, Long> getRepository(){
    return repository;
  }
  
  // 根据用户id获取token信息
  public UserToken getTokenByUserId(Long user_id){
    return repository.findByUserId(user_id);
  }
}
